package yxy.cherry.battle.module.record.stream;

import yxy.cherry.battle.Fighter;
import yxy.cherry.battle.module.affix.Buff;

import java.util.ArrayList;

public class RecordStream_07_驱散效果 extends RecordStream {

	private Fighter target;
	private ArrayList<String> buffCodeList = new ArrayList<>();
	private ArrayList<String> buffSeqList = new ArrayList<>();

	public RecordStream_07_驱散效果(Fighter target) {
		this.target = target;

	}

	public void addBuffs(ArrayList<Buff> buffs){
		for(Buff buff:buffs){
			buffCodeList.add(buff.getBuffCode());
			buffSeqList.add(buff.getBuffCodeSeq());
		}
	}

	public boolean is有效() {
		return buffSeqList.size() > 0;
	}

	@Override
	protected void _record() {
		sb().append(7);
		sb().append("|");
		sb().append(target.getFighterPosition().code());
		sb().append("|");
		sb().append(buffCodeList.toString());
		sb().append("|");
		sb().append(buffSeqList.toString());
		sb().append(";");
	}

}
